package activities;

import com.androidmodule.onthego.R;

import extras.Utilities;
import fragments.FragmentReservaParticular;
import fragments.FragmentListaReservas.OnReservaSeleccionadaListener;
import fragments.FragmentReservaParticular.OnReservaCaducadaListener;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.FragmentActivity;
import android.support.v4.app.FragmentTransaction;

/**
 * clae pensada unicamente para abrir una activity con el resultado de una reerv ane particular, 
 * cuando se abre en un telefono
 * @author Marco
 *
 */
public class DetailReserva extends FragmentActivity implements
OnReservaSeleccionadaListener, OnReservaCaducadaListener{
	FragmentReservaParticular detalleReserva;
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.layout_reserva_detalle);
		String codigo=this.getIntent().getExtras().getString("codigo");
		 detalleReserva = new FragmentReservaParticular();
         Bundle parametroBundle = new Bundle();
 		parametroBundle.putString("codigo", codigo);
 		detalleReserva.setArguments(parametroBundle);
 	     // Execute a transaction, replacing any existing fragment
         // with this one inside the frame.
 		
         FragmentTransaction ft = this.getSupportFragmentManager().beginTransaction();
         ft.replace(R.id.container_detalle_reserva, detalleReserva);
         ft.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_FADE);
         ft.commit();
		

	}

	@Override
	public void onNotificarReservaCaducada(String parametroCodigoReserva) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void onReservaSeleccionada(String codigoReserva) {
		// TODO Auto-generated method stub
		
	}
	
	protected void onActivityResult(int requestCode, int resultCode, Intent data) {
	    // Check which request we're responding to
	   super.onActivityResult(requestCode, resultCode, data);
	   detalleReserva.facebookSubmited(requestCode, resultCode, data);
	}
}
